﻿@model HZU.ZP.Domain.Model.Company
@{
    Layout = "_AdminLayout";
}
<script>
     function update(companyId,companyStatus)
    {
        $.ajax({
                    type: "post",
            url: "/Company/UpdateCompany",
            data: "id=" + companyId + "&status=" + companyStatus + "&remark=" + $("#remark").val(),
                    success: function (message) {
                        if (message.returnCode == "001") {
                            alert("处理成功！")
                            location.href="/Company/CompanyList?status=@Model.Status";
    }
    else if (message.returnCode == "999")
        alert("处理失败！该企业不存在或已处理，请刷新！");
}
});
    }
</script>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                <label for="exampleInputEmail1">企业名称：</label>
                <span class="form-control">@Model.CompanyName</span>
            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                <label for="exampleInputEmail1">企业邮箱：</label>
                <span class="form-control">@Model.Email</span>
            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                <label for="exampleInputEmail1">工商注册号：</label>
                <span class="form-control">@Model.CompanyNumber</span>
            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                <label for="exampleInputEmail1">营业执照图片：</label>
                <img src="@Model.BusinessLicense" style="width:100%;" />

            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                <label for="exampleInputEmail1">审核理由：</label>
                <input type="text" class="form-control" id="remark" />
            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="form-group">
                @switch (Model.Status)
                {
                    case 0:
                        {
                            <button onclick="update(@Model.Id,1)" class="btn btn-default btn-info" style="width:48%">
                                审核通过
                            </button>
                            <button onclick="update(@Model.Id,2)" class="btn btn-default btn-warning" style="width:48%">
                                审核不通过
                            </button>
                        };
                        break;
                    case 1:
                        {
                            <a href="/Position/CompanyPosition?companyId=@Model.Id" class="btn btn-default btn-info" style="width:48%">职位管理</a>
                            <button onclick="update(@Model.Id,3)" class="btn btn-default btn-warning" style="width:48%">
                                加入黑名单
                            </button>
                        };
                        break;
                    case 2:
                        {
                        };
                        break;
                    case 3:
                        {
                            <button onclick="update(@Model.Id,0)" class="btn btn-default btn-info" style="width:48%">
                                移除黑名单
                            </button>
                        };
                        break;
                }
            </div>
        </div>
        <div class="col-md-6 column">
        </div>
    </div>
</div>